// RUN: %cxxamp -emit-llvm -S -c %s -o -|%cppfilt|%FileCheck %s
#include <cstdlib> //for size_t
//Serialization object decl
namespace Concurrency {
class Serialize {
 public:
  void Append(size_t x, const void *s);
};
}

class baz {
 public:
  int cho(void) restrict(amp) {
    return 45;
  }
  baz(void): foo(1234) {}
#if 0
  __attribute__((annotate("serialize")))/* For compiler */
  __cxxamp_serialize(Concurrency::Serialize& s) const;
#endif
 private:
  int foo;
};

int kerker(void) restrict(amp,cpu) {
  baz b1;
  Concurrency::Serialize s;
  b1.__cxxamp_serialize(s);
  return b1.cho();
}
// The definition should be generated by clang
// CHECK: define {{.*}}void @baz::__cxxamp_serialize(Concurrency::Serialize&)
